<template>
  <f7-page>
    <f7-navbar title="我的客服" back-link="返回"></f7-navbar>
    <div class="content-padding">
      <custom-input label="标题" placeholder="请输入标题" v-model="formItems.title"></custom-input>
      <custom-input type="textarea" label="内容" placeholder="请输入内容" v-model="formItems.content"></custom-input>
      <f7-button fill @click="handleAdd">确定</f7-button>
      <p><f7-link href="/service-record/">提交记录</f7-link></p>
    </div>
  </f7-page>
</template>

<script>
  import { addServiceQue } from "../api/my";

  export default {
    name: "my-customer-service",
    data() {
      return {
        formItems: {
          title: '',
          content: ''
        }
      }
    },
    methods: {
      handleAdd() {
        addServiceQue(this.formItems).then(() => {
          this.$f7router.navigate('/service-record/')
        })
      }
    }
  }
</script>

<style scoped lang="scss">
  .content-padding {
    margin: 50px 0;
    .button {
      margin-top: 100px;
    }
    p {
      text-align: right;
      padding: $padding 0;
    }
  }
</style>